import router from './router'
// balel的plugins配置
const plugins = []
if (process.env.NODE_ENV === 'production') {
	plugins.push('transform-remove-console');
}

export default {
	head: {
		title: '思向网络',
		meta: [{
				charset: 'utf-8'
			},
			{
				name: 'viewport',
				content: 'width=device-width,height=device-height,initial-scale=1.0,maximum-scale=1.0,user-scalable=no'
			},
			{
				hid: 'description',
				name: 'description',
				content: ''
			}
		],
		link: [{rel: 'icon',type: 'image/x-icon',href: '/favicon.ico'}, 
		{
			rel: "stylesheet",
			href: "/css/zwyCss.css"
		},
		{
			rel: "stylesheet",
			href: "/css/index.css"
		}],
		script: [

		],
		__dangerouslyDisableSanitizers: ['script']
	},
	css: [
		'ant-design-vue/dist/antd.css',
		'~static/global.css'
	],
	plugins: [
		'@/plugins/polyfill',
		'@/plugins/ant-design',
		'@/plugins/proto' // 注册全局原形方法 prototype
	],
	/*
	 ** Nuxt.js router
	 */
	router: {
		// 在每页渲染前运行 middleware/auth.js 中间件的逻辑
		middleware: 'auth',
		// 配置路由的模式，ssr服务端渲染的特性，不建议修改该配置。
		// mode: 'hash',
		base: '/',
		extendRoutes(routes, resolve) {
			routes.length = 0 // 清除 nuxt 自己生成的路由，这里不要用 空数组 赋值
			routes.push(...router)
		}
	},
	loading: {
		color: 'SkyBlue',
	},
	// Auto import components (https://go.nuxtjs.dev/config-components)
	components: false,

	// Modules for dev and build (recommended) (https://go.nuxtjs.dev/config-modules)
	buildModules: [],

	// Modules (https://go.nuxtjs.dev/config-modules)
	modules: [
		// https://go.nuxtjs.dev/axios
		'@nuxtjs/axios'
	],
	// Axios module configuration (https://go.nuxtjs.dev/config-axios)
	axios: {

	},
	// 代理配置
	// proxy: { //
	//   '/api': {
	//     // 需要代理的目标服务器
	//     target: 'http://XXX.XXX.XXX/',
	//     ws: true,
	//     changeOrigin:true,//允许跨域
	//     pathRewrite: {
	//       '^/api': '/api' // 重写
	//     }
	//   }
	// },
	server: {
		port: 3000, // default: 3000
		host: '0.0.0.0' // default: localhost,
	},
	// Build Configuration (https://go.nuxtjs.dev/config-build)
	build: {
		transpile: ['resize-detector'],
		// balel配置
		babel: {
			plugins: plugins
		},
		extend(config, ctx) { //  webpack自定义配置
		}
	}
}
